home *** CD-ROM | disk | FTP | other *** search
Wrap
ggggllllSSSStttteeeennnncccciiiillllFFFFuuuunnnncccc((((3333GGGG)))) OOOOppppeeeennnnGGGGLLLL RRRReeeeffffeeeerrrreeeennnncccceeee ggggllllSSSStttteeeennnncccciiiillllFFFFuuuunnnncccc((((3333GGGG)))) NNNNAAAAMMMMEEEE ggggllllSSSStttteeeennnncccciiiillllFFFFuuuunnnncccc - set function and reference value for stencil testing CCCC SSSSPPPPEEEECCCCIIIIFFFFIIIICCCCAAAATTTTIIIIOOOONNNN void ggggllllSSSStttteeeennnncccciiiillllFFFFuuuunnnncccc( GLenum _f_u_n_c, GLint _r_e_f, GLuint _m_a_s_k ) PPPPAAAARRRRAAAAMMMMEEEETTTTEEEERRRRSSSS _f_u_n_c Specifies the test function. Eight tokens are valid: GGGGLLLL____NNNNEEEEVVVVEEEERRRR, GGGGLLLL____LLLLEEEESSSSSSSS, GGGGLLLL____LLLLEEEEQQQQUUUUAAAALLLL, GGGGLLLL____GGGGRRRREEEEAAAATTTTEEEERRRR, GGGGLLLL____GGGGEEEEQQQQUUUUAAAALLLL, GGGGLLLL____EEEEQQQQUUUUAAAALLLL, GGGGLLLL____NNNNOOOOTTTTEEEEQQQQUUUUAAAALLLL, and GGGGLLLL____AAAALLLLWWWWAAAAYYYYSSSS. The initial value is GGGGLLLL____AAAALLLLWWWWAAAAYYYYSSSS. _r_e_f Specifies the reference value for the stencil test. _r_e_f is clamped n to the range [0,2 -1], where n is the number of bitplanes in the stencil buffer. The initial value is 0. _m_a_s_k Specifies a mask that is ANDed with both the reference value and the stored stencil value when the test is done. The initial value is all 1's. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN Stenciling, like depth-buffering, enables and disables drawing on a per- pixel basis. You draw into the stencil planes using GL drawing primitives, then render geometry and images, using the stencil planes to mask out portions of the screen. Stenciling is typically used in multipass rendering algorithms to achieve special effects, such as decals, outlining, and constructive solid geometry rendering. The stencil test conditionally eliminates a pixel based on the outcome of a comparison between the reference value and the value in the stencil buffer. To enable and disable the test, call ggggllllEEEEnnnnaaaabbbblllleeee and ggggllllDDDDiiiissssaaaabbbblllleeee with argument GGGGLLLL____SSSSTTTTEEEENNNNCCCCIIIILLLL____TTTTEEEESSSSTTTT. To specify actions based on the outcome of the stencil test, call ggggllllSSSStttteeeennnncccciiiillllOOOOpppp. _f_u_n_c is a symbolic constant that determines the stencil comparison function. It accepts one of eight values, shown in the following list. _r_e_f is an integer reference value that is used in the stencil comparison. n It is clamped to the range [0,2 -1], where n is the number of bitplanes in the stencil buffer. _m_a_s_k is bitwise ANDed with both the reference value and the stored stencil value, with the ANDed values participating in the comparison. If _s_t_e_n_c_i_l represents the value stored in the corresponding stencil buffer location, the following list shows the effect of each comparison function that can be specified by _f_u_n_c. Only if the comparison succeeds is the pixel passed through to the next stage in the rasterization process (see ggggllllSSSStttteeeennnncccciiiillllOOOOpppp). All tests treat _s_t_e_n_c_i_l values as unsigned n integers in the range [0,2 -1], where n is the number of bitplanes in the stencil buffer. PPPPaaaaggggeeee 1111 ggggllllSSSStttteeeennnncccciiiillllFFFFuuuunnnncccc((((3333GGGG)))) OOOOppppeeeennnnGGGGLLLL RRRReeeeffffeeeerrrreeeennnncccceeee ggggllllSSSStttteeeennnncccciiiillllFFFFuuuunnnncccc((((3333GGGG)))) The following values are accepted by _f_u_n_c: GGGGLLLL____NNNNEEEEVVVVEEEERRRR Always fails. GGGGLLLL____LLLLEEEESSSSSSSS Passes if ( _r_e_f & _m_a_s_k ) < ( _s_t_e_n_c_i_l & _m_a_s_k ). GGGGLLLL____LLLLEEEEQQQQUUUUAAAALLLL Passes if ( _r_e_f & _m_a_s_k ) _< ( _s_t_e_n_c_i_l & _m_a_s_k ). GGGGLLLL____GGGGRRRREEEEAAAATTTTEEEERRRR Passes if ( _r_e_f & _m_a_s_k ) > ( _s_t_e_n_c_i_l & _m_a_s_k ). GGGGLLLL____GGGGEEEEQQQQUUUUAAAALLLL Passes if ( _r_e_f & _m_a_s_k ) _> ( _s_t_e_n_c_i_l & _m_a_s_k ). GGGGLLLL____EEEEQQQQUUUUAAAALLLL Passes if ( _r_e_f & _m_a_s_k ) = ( _s_t_e_n_c_i_l & _m_a_s_k ). GGGGLLLL____NNNNOOOOTTTTEEEEQQQQUUUUAAAALLLL Passes if ( _r_e_f & _m_a_s_k ) =/ ( _s_t_e_n_c_i_l & _m_a_s_k ). GGGGLLLL____AAAALLLLWWWWAAAAYYYYSSSS Always passes. NNNNOOOOTTTTEEEESSSS Initially, the stencil test is disabled. If there is no stencil buffer, no stencil modification can occur and it is as if the stencil test always passes. EEEERRRRRRRROOOORRRRSSSS GGGGLLLL____IIIINNNNVVVVAAAALLLLIIIIDDDD____EEEENNNNUUUUMMMM is generated if _f_u_n_c is not one of the eight accepted values. GGGGLLLL____IIIINNNNVVVVAAAALLLLIIIIDDDD____OOOOPPPPEEEERRRRAAAATTTTIIIIOOOONNNN is generated if ggggllllSSSStttteeeennnncccciiiillllFFFFuuuunnnncccc is executed between the execution of ggggllllBBBBeeeeggggiiiinnnn and the corresponding execution of ggggllllEEEEnnnndddd. AAAASSSSSSSSOOOOCCCCIIIIAAAATTTTEEEEDDDD GGGGEEEETTTTSSSS ggggllllGGGGeeeetttt with argument GGGGLLLL____SSSSTTTTEEEENNNNCCCCIIIILLLL____FFFFUUUUNNNNCCCC ggggllllGGGGeeeetttt with argument GGGGLLLL____SSSSTTTTEEEENNNNCCCCIIIILLLL____VVVVAAAALLLLUUUUEEEE____MMMMAAAASSSSKKKK ggggllllGGGGeeeetttt with argument GGGGLLLL____SSSSTTTTEEEENNNNCCCCIIIILLLL____RRRREEEEFFFF ggggllllGGGGeeeetttt with argument GGGGLLLL____SSSSTTTTEEEENNNNCCCCIIIILLLL____BBBBIIIITTTTSSSS ggggllllIIIIssssEEEEnnnnaaaabbbblllleeeedddd with argument GGGGLLLL____SSSSTTTTEEEENNNNCCCCIIIILLLL____TTTTEEEESSSSTTTT SSSSEEEEEEEE AAAALLLLSSSSOOOO ggggllllAAAAllllpppphhhhaaaaFFFFuuuunnnncccc, ggggllllBBBBlllleeeennnnddddFFFFuuuunnnncccc, ggggllllDDDDeeeepppptttthhhhFFFFuuuunnnncccc, ggggllllEEEEnnnnaaaabbbblllleeee, ggggllllIIIIssssEEEEnnnnaaaabbbblllleeeedddd, ggggllllLLLLooooggggiiiiccccOOOOpppp, ggggllllSSSStttteeeennnncccciiiillllOOOOpppp PPPPaaaaggggeeee 2222